<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .box {
      width: 500px;
      height: 500px;
      border: 1px solid black;
    }

    .box::after {
      content: '';
      display: block;
      width: 100px;
      height: 100px;
      background-color: red;
    }

    h2[abc="true"] {
      color: red;
    }
  </style>
</head>

<body>
  <div class="box">
    <!-- ::before -->
    <h2>hello</h2>
    <!-- ::after -->
  </div>
  <h2>hello1</h2>
  <h2 abc="true">hello world</h2>
</body>

</html>